package com.yeyuanqi.hottop.scheduletask;

import com.yeyuanqi.hottop.service.*;
import com.yeyuanqi.hottop.untils.PythonUntils;
import com.yeyuanqi.hottop.vo.HotListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 更新最新热搜缓存定时任务和python爬虫定时任务
 * @author: yeyuanqi
 * @date: 2021/11/11
 */

@Component
public class CrawlerScheduleTask {

    @Autowired
    private PythonUntils pythonUntils;

    @Autowired
    RedisService redisService;

    @Autowired
    TBaiduhotService tBaiduhotService;

    @Autowired
    TJinrihotService tJinrihotService;

    @Autowired
    TTxhotService tTxhotService;

    @Autowired
    TWeibohotService tWeibohotService;


    //    腾讯新闻热搜约15分钟获取一次

    @Scheduled(cron = "00 0,15,30,45 * * * ?")
    public void crawlerpy(){
        pythonUntils.starttengxunxinwen();
        pythonUntils.startbaidu();
        pythonUntils.startjinritoutiao();
        pythonUntils.startweibo();
    }

//    //    微博热搜15分钟获取一次
//
//    @Scheduled(cron = "0 0,15,30,45 * * * ?")
//    public void weibopy(){
//
//    }
//
//    //    百度热搜15分钟获取一次
//
//    @Scheduled(cron = "5 0,15,30,45 * * * ?")
//    public void baidupy(){
//
//    }
//
//    //    今日头条热搜15分钟获取一次
//    @Scheduled(cron = "5 0,15,30,45 * * * ?")
//    public void jinritoutiaopy(){
//
//    }

}
